//
//  main.c
//  C_Foundation 0
//
//  Created by Robin on 16/3/15.
//  Copyright © 2016年 cnbm. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>

void show(){
    
    int decks;
    puts("输入有几幅牌");
    
    scanf("%i",&decks);
    
    if (decks < 1) {
        printf("无效的幅数\n");
        return;
    }
    printf("%s 说一共有 %i 张牌\n","Roben",decks*52);
}

int main(int argc, const char * argv[]) {
    // insert code here...
    //printf("Hello, World!\n");
    //show();
    
    char card_name[2];
    
    puts("输入牌名:");
    scanf("%2s",card_name);
    
    int val = 0;
    
    if (card_name[0] == 'Q') {
        val = 10;
    }else if (card_name[0] == 'K'){
        val = 10;
    }else if (card_name[0] == 'J'){
        val = 10;
    }else if (card_name[0] == 'A'){
        val = 11;
    }else{
        val = atoi(card_name);
    }
    
    printf("这张牌的点数是: %d \n",val);
    
    return 0;
}


